Settings via QR Code
Overview
On the Settings screen, the Scan Barcode action lets you configure the app's backend connection by scanning a single QR code, instead of typing every field by hand. This works for both backend types the app supports:
- Commerce (OmniService) settings
- Business Central settings — either SaaS or On-premises
The app automatically detects which kind of settings a scanned QR code contains and applies them — you don't need to select a mode first. If the QR code configures a different backend than the one currently active, the app switches to it automatically as part of applying the scan.
To scan a settings QR code:
- Open Settings.
- Tap Camera Icon.
- Point the camera at the QR code.
If the code is valid, the relevant fields are filled in immediately and the connection type switches if needed. If something is wrong with the code, a message tells you exactly what's missing so you (or whoever generated the code) can fix it and rescan.
The three QR code types are described below, each with an example payload. A QR code is a JSON object encoded as a QR symbol — the examples show the JSON before encoding.
A note on Store ID, Terminal ID, Update Frequency, and Batch Size: these four settings are not specific to Commerce — they control local replication and apply the same way no matter which backend the device connects to. Because of that, all three QR code types below can optionally include them, and doing so fills in the same "Replication Settings" fields on the Settings screen regardless of which connection type you're configuring.
Type 1 — Commerce (OmniService) Settings
Use this to configure the app to connect to an OmniService backend.
Example payload:
{
"Url": "https://commerce.example.com/OmniServiceHost/",
"StoreId": "S0001",
"TerminalId": "P0032",
"Timeout": 30,
"UpdateFrequency": 30,
"BatchSize": 50,
}
Fields:
| Field | Required? | Description |
|---|---|---|
Url
|
Required | The OmniService server URL. |
StoreId
|
Required | The store this terminal belongs to. |
TerminalId
|
Required | The terminal ID for this device. |
Timeout
|
Optional | Connection timeout in seconds. If omitted, the device keeps its current value. |
UpdateFrequency
|
Optional | Replication interval in minutes. If omitted, the device keeps its current value. |
BatchSize
|
Optional | Replication batch size. If omitted, the device keeps its current value. |
Scanning this code switches the app to Commerce mode if it wasn't already, and fills in Store ID, Terminal ID, and Server URL on the Settings screen. Any optional field left out of the code is not cleared — the device's existing value stays as-is.
Type 2 — Business Central Settings (SaaS)
Use this to configure the app to connect to an LS Central / Business Central SaaS tenant.
Example payload:
{
"LSCentralWsUrl": "https://businesscentral.dynamics.com/tenant-id/env/ws/CRONUS/Codeunit",
"LSCentralODataUrl": "https://businesscentral.dynamics.com/tenant-id/env/api/lsretail/",
"LSCentralTenantId": "3c9f1a2b-...-tenant-guid",
"LSCentralClientId": "6e7d8c9a-...-client-guid",
"LSCentralClientSecret": "your-client-secret-here",
"LSCentralTimeout": 30,
"LSCentralCompanyId": "9b1e4f2a-...-company-guid",
"StoreId": "S0001",
"TerminalId": "P0032",
"UpdateFrequency": 30,
"BatchSize": 50
}
Note that LSCentralProtocol is absent here — an absent (or blank) protocol means SaaS, so this code doesn't need to specify it explicitly. See Type 3 below for how on-premises codes differ.
Also note StoreId, TerminalId, UpdateFrequency, and BatchSize — these are the same optional Replication Settings fields described in the Commerce example above. They work identically here; a Business Central QR code can include them, omit them, or include only some of them.
Fields:
| Field | Required? | Description |
|---|---|---|
LSCentralWsUrl
|
Required | The SOAP web service URL. |
LSCentralODataUrl
|
Required | The OData API URL. |
LSCentralTenantId
|
Required for SaaS | The Business Central tenant ID. Not needed for on-premises (see Type 3). |
LSCentralClientId
|
Required | OAuth client ID. |
LSCentralClientSecret
|
Required | OAuth client secret. |
LSCentralTimeout
|
Optional | Connection timeout in seconds. If omitted, the device keeps its current value. |
LSCentralProtocol
|
Optional | Leave out for SaaS. Set to a non-SaaS value (e.g. Tls12) for on-premises — see Type 3. |
LSCentralCompanyId
|
Optional | The Business Central company ID (a GUID), not the company display name. Used to connect to web services through API Pages, requires BC 29.0 or newer. Leave out if not needed — no error is shown, and any previously configured company is left untouched. |
StoreId
|
Optional | Shared Replication Settings field — same as the Commerce type. If omitted, the device keeps its current value. |
TerminalId
|
Optional | Shared Replication Settings field — same as the Commerce type. If omitted, the device keeps its current value. |
UpdateFrequency
|
Optional | Shared Replication Settings field — same as the Commerce type. If omitted, the device keeps its current value. |
BatchSize
|
Optional | Shared Replication Settings field — same as the Commerce type. If omitted, the device keeps its current value. |
⚠️ Important — LSCentralCompanyId must be the company's ID, not its name. Using the display name shown in the web service URL (for example "CRONUS") instead of the actual company ID will cause replication, transaction posting, and more to fail. If you're not sure what the company ID is, leave this field out rather than guessing — the app works correctly without it.
Scanning this code switches the app to Business Central (SaaS) mode if it wasn't already, and fills in the Business Central fields on the Settings screen.
Type 3 — Business Central Settings (On-Premises)
Same as Type 2, but for an on-premises Business Central server, and without a tenant ID — on-premises connections don't use one.
Example payload:
{
"LSCentralWsUrl": "https://bc-onprem.example.local:7048/BC/ws/CRONUS/Codeunit",
"LSCentralODataUrl": "https://bc-onprem.example.local:7048/BC/api/lsretail/",
"LSCentralProtocol": "Tls12",
"LSCentralClientId": "on-prem-username",
"LSCentralClientSecret": "on-prem-access-key",
"LSCentralTimeout": 30
}
What's different from Type 2 (SaaS):
| Field | Required? | Description |
|---|---|---|
LSCentralProtocol
|
Required | Any non-SaaS value (e.g. Tls12) tells the app this is an on-premises connection. |
LSCentralTenantId
|
Not required | On-premises Business Central has no tenant concept. Leave it out — the app won't ask for it and won't show it on screen in on-premises mode. |
LSCentralClientId / LSCentralClientSecret |
Required | On-premises, these fields hold the Basic-authentication user name and access key instead of an OAuth client ID/secret — same JSON fields, different meaning. The Settings screen relabels them accordingly ("LS Central user name" / "Web service access key") when in on-premises mode. |
All other fields (LSCentralWsUrl, LSCentralODataUrl, LSCentralTimeout, LSCentralCompanyId, and the shared StoreId/TerminalId/UpdateFrequency/BatchSize Replication Settings fields) behave exactly as in Type 2.
Scanning this code switches the app to Business Central (On-premises) mode.